package com.hd.trans.network;


import com.hd.trans.network.annotation.FileName;
import com.hd.trans.network.annotation.Get;
import com.hd.trans.network.annotation.Set;
import com.hd.trans.network.bean.UserInfoBean;

/**
 * Author:  yang
 * Date:  2020-01-18 22:14
 * Desc:  常用数据保存
 */
@FileName("preference.common")
public interface CommonPreference {

    String FIRST_RUN = "first_run"; //是否首次运行
    String SHOW_GUIDE = "show_guide"; //是否显示新手引导
    String SHOW_GUIDE_OCR = "show_guide_ocr"; //是否显示新手引导(OCR)
    String SHOW_PROTOCOL = "show_protocol"; //是否显示隐私协议
    String APP_START_COUNT = "app_start_count"; //App启动次数
    String SERVER_TIME_DISTANCE = "server_time_distance"; //服务器时间戳与本地时间差值
    String SHOW_NOTIFICATION_DIALOG = "show_notification_dialog";//申请通知权限弹窗
    String SHOW_NEW_OVAL = "show_new_oval";//显示新功能圆点
    String SHOW_WORD_TRANS_DEMO = "show_word_trans_demo";//显示取词翻译的demo演示
    String DAO_VERSION = "dao_version";//数据库版本
    String LANGUAGE_VERSION = "language_version";//语种更新版本
    String APP_VERSION = "application_version";//app更新版本
    String NEVER_SHOW_THIS_TIPS = "never_show_this_tips";//不再提示
    String EXPERIENCED = "EXPERIENCED";//是否已经体验
    String EXPERIENCED_CLOSE = "EXPERIENCED_CLOSE";//是否已经关闭体验窗口
    String EXAMPLE_CREATE_TIME = "EXAMPLE_CREATE_TIME";//体验例子
    String TONG_NEW_TIP = "TONG_NEW_TIP";//同声传译新功能提示
    String TONG_ALLOW_SAVE = "TONG_ALLOW_SAVE";//同声传译是否开启自动保存
    String USER_INFO = "USER_INFO";//用户信息
    String AI_TRANS_LIMIT_NUMBER = "AI_TRANS_LIMIT_NUMBER";//AI翻译限量体验次数（非VIP用户）
    String AI_TRANS_VIP_LIMIT_NUMBER = "AI_TRANS_VIP_LIMIT_NUMBER";//AI翻译限量体验次数（VIP用户）
    String AI_TRANS_REMAINDER_LIMIT_NUMBER = "AI_TRANS_REMAINDER_LIMIT_NUMBER";//AI翻译限量体验剩余次数（VIP用户）
    String AI_PREFIX = "AI_PREFIX";//AI翻译嵌入前缀
    String AI_SUFFIX = "AI_SUFFIX";//AI翻译嵌入后缀
    String OPEN_OFFLINE = "OPEN_OFFLINE";//开启离线翻译优先逻辑

    String AI_TRANS_LIMIT_DATE = "AI_TRANS_LIMIT_DATE";//AI翻译限量体验日期
    String MainActivity_time = "MainActivity_time"; //优惠倒计时
    String MainActivity_showTime = "MainActivity_showTime"; //优惠上次显示时间点
    String MainActivity_date = "MainActivity_date"; //日期倒计时


    String TranslationFile = "translation_file"; //文本翻译。纪录翻译语言用的
    String Trans_time = "Trans_time"; //文本翻译免费次数


    /**
     * 保存是否显示新手引导
     */
    @Set(SHOW_GUIDE)
    void saveShowGuide(boolean show);

    @Get(value = SHOW_GUIDE, defaultBoolean = false)
    boolean isShowGuide();


    /**
     * 保存是否显示新手引导(OCR)
     */
    @Set(SHOW_GUIDE_OCR)
    void saveShowGuideOCR(boolean show);

    @Get(value = SHOW_GUIDE_OCR, defaultBoolean = true)
    boolean isShowGuideOCR();


    /**
     * 保存是否显示隐私协议
     */
    @Set(SHOW_PROTOCOL)
    void saveShowProtocol(boolean show);

    @Get(value = SHOW_PROTOCOL, defaultBoolean = true)
    boolean isShowProtocol();


    /**
     * 保存App是否首次运行
     */
    @Set(FIRST_RUN)
    void saveFirstRun(boolean isFirstRun);

    @Get(value = FIRST_RUN, defaultBoolean = true)
    boolean isFirstRun();


    /**
     * 保存App启动次数
     */
    @Set(APP_START_COUNT)
    void saveAppStartCount(int count);

    @Get(APP_START_COUNT)
    int getAppStartCount();


    /**
     * 保存服务器时间戳与本地时间差值
     */
    @Set(SERVER_TIME_DISTANCE)
    void saveTimeDistance(long serverTimeDistance);

    @Get(value = SERVER_TIME_DISTANCE, defaultLong = 0L)
    long getTimeDistance();


    /**
     * 保存服务器时间戳与本地时间差值
     */
    @Set(TranslationFile)
    void saveTranslationFileLanguage(String serverTimeDistance);

    @Get(TranslationFile)
    String getTranslationFileLanguage();

    @Set(SHOW_NOTIFICATION_DIALOG)
    void saveNotificationDialogTime(long time);

    @Get(value = SHOW_NOTIFICATION_DIALOG, defaultLong = 0L)
    long notificationDialogLastTime();

    @Set(SHOW_NEW_OVAL)
    void setShowNewOval(boolean time);

    @Get(value = SHOW_NEW_OVAL, defaultBoolean = true)
    boolean isShowNewOval();

    /**
     * 优惠倒计时时间
     */
    @Set(MainActivity_time)
    void saveMainActivityTime(long time);

    /**
     * 优惠倒计时时间
     */
    @Get(MainActivity_time)
    long getMainActivityTime();

    /**
     * 优惠显示时间点
     */
    @Set(MainActivity_showTime)
    void saveMainActivityShowTime(long time);

    /**
     * 优惠显示时间点
     */
    @Get(MainActivity_showTime)
    long getMainActivityShowTime();

    /**
     * 首页vip入口，倒计时日期
     */
    @Set(MainActivity_date)
    void saveMainActivityDate(int date);

    /**
     * 首页vip入口，倒计时日期
     */
    @Get(MainActivity_date)
    int getMainActivityDate();

    @Set(Trans_time)
    void saveTransTimes(int date);

    @Get(value = Trans_time, defaultInt = -1)
    int getTransTimes();

    @Set(SHOW_WORD_TRANS_DEMO)
    void saveWordTransDemoStatus(boolean show);

    @Get(value = SHOW_WORD_TRANS_DEMO, defaultBoolean = true)
    boolean getWordTransDemoStatus();

    @Set(DAO_VERSION)
    void saveDaoVersion(int version);

    @Get(value = DAO_VERSION)
    int getDaoVersion();

    @Set(LANGUAGE_VERSION)
    void setLanguageVersion(int version);

    @Get(value = LANGUAGE_VERSION, defaultInt = 0)
    int getLanguageVersion();

    @Set(APP_VERSION)
    void setAppVersion(int version);

    @Get(value = APP_VERSION, defaultInt = 0)
    int getAppVersion();

    @Set(NEVER_SHOW_THIS_TIPS)
    void setNeverShowThisTips(boolean show);
    @Get(value = NEVER_SHOW_THIS_TIPS, defaultBoolean = false)
    boolean isNeverShowThisTips();

    @Set(EXPERIENCED)
    void setExperienced(boolean experienced);
    @Get(value = EXPERIENCED, defaultBoolean = false)
    boolean isExperienced();

    @Set(EXPERIENCED_CLOSE)
    void setExperiencedClose(boolean experienced);
    @Get(value = EXPERIENCED_CLOSE, defaultBoolean = false)
    boolean isExperiencedClose();

    @Set(EXAMPLE_CREATE_TIME)
    void saveExampleCreateTime(long createTime);

    @Get(value = EXAMPLE_CREATE_TIME)
    long getExampleCreateTime();

    @Set(TONG_NEW_TIP)
    void setTongNewTip(boolean experienced);
    @Get(value = TONG_NEW_TIP, defaultBoolean = false)
    boolean isTongNewTip();

    @Set(TONG_ALLOW_SAVE)
    void setAllowSaveChecked(boolean isChecked);
    @Get(value = TONG_ALLOW_SAVE, defaultBoolean = true)
    boolean isAllowSaveChecked();

    @Set(USER_INFO)
    void setUserInfo(String json);
    @Get(value = USER_INFO)
    String getUserInfo();


    @Set(AI_TRANS_LIMIT_DATE)
    void setAiTransLimitDate(long time);
    @Get(value = AI_TRANS_LIMIT_DATE)
    long getAiTransLimitDate();

    @Set(AI_TRANS_REMAINDER_LIMIT_NUMBER)
    void setAiTransRemainderLimitNumber(int time);
    @Get(value = AI_TRANS_REMAINDER_LIMIT_NUMBER, defaultInt = 20)
    int getAiTransRemainderLimitNumber();

    @Set(AI_TRANS_VIP_LIMIT_NUMBER)
    void setAiTransVipLimitNumber(int time);
    @Get(value = AI_TRANS_VIP_LIMIT_NUMBER, defaultInt = 20)
    int getAiTransVipLimitNumber();

    @Set(AI_TRANS_LIMIT_NUMBER)
    void setAiTransLimitNumber(int time);
    @Get(value = AI_TRANS_LIMIT_NUMBER, defaultInt = 0)
    int getAiTransLimitNumber();

    @Set(AI_PREFIX)
    void setAiPrefix(String prefix);
    @Get(value = AI_PREFIX, defaultString = "")
    String getAiPrefix();

    @Set(AI_SUFFIX)
    void setAiSuffix(String suffix);
    @Get(value = AI_SUFFIX, defaultString = "")
    String getAiSuffix();
    @Set(value = OPEN_OFFLINE)
    void setOpenOfflineTrans(boolean isOpenOfflineTrans);
    @Get(value = OPEN_OFFLINE, defaultBoolean = false)
    boolean isOpenOfflineTrans();
}
